﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="TeamScheduling.aspx.cs" Inherits="WebClient.TeamScheduling" %>

<%@ MasterType VirtualPath="~/Site.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <h2>
        Team Scheduling
    </h2>
    <asp:UpdatePanel ID="UpdatePanel" UpdateMode="Conditional" runat="server">
        <ContentTemplate>
            <p>
                Please Select a Team:
                <asp:ComboBox ID="TeamSelect" runat="server" AutoPostBack="true" DropDownStyle="DropDownList"
                    CssClass="" OnTextChanged="LoadNewData" OnLoad="TeamSelect_Load" />
                &nbsp;</p>
            <p>
                Schedule Select:
                <asp:ComboBox ID="ScheduleSelect" runat="server" AutoPostBack="true" DropDownStyle="DropDownList"
                    CssClass="" OnTextChanged="LoadNewData" OnLoad="TeamSelect_Load" />
            </p>
            <asp:Panel ID="ViewSchedulesPanel" runat="server" Visible="true">
                <asp:LinkButton ID="AddNewTimeSlot" runat="server" 
                    onclick="AddNewTimeSlot_Click">Add Timeslot</asp:LinkButton>
                <asp:Panel ID="AddTimeSlotPanel" runat="server" Visible = "false">
                <div class="accountInfo">
                        <fieldset class="register">
                            <legend>Add TimeSlot</legend>
                            <p>
                                <asp:Label ID="TimeSlotStart" runat="server" AssociatedControlID="ScheduleName">Start Time:</asp:Label>
                                
                            </p>
                            <p>
                                Hrs: <asp:TextBox ID="StartHrs" runat="server" CssClass="textEntry" Width="60"/> 
                                &nbsp; Min: <asp:TextBox ID="StartMins" runat="server" CssClass="textEntry" Width="60" /> 
                                &nbsp;&nbsp;&nbsp;
                                <asp:ComboBox ID="StartAP" runat="server" DropDownStyle="DropDownList">
                                <asp:ListItem> P.M.</asp:ListItem>
                                <asp:ListItem> A.M.</asp:ListItem>
                                </asp:ComboBox>

                            </p>

                            <p>
                                <asp:Label ID="EndTime" runat="server" AssociatedControlID="ScheduleName">End Time:</asp:Label>
                                
                            </p>
                            <p>
                                Hrs: <asp:TextBox ID="EndHrs" runat="server" CssClass="textEntry" Width="60"/> 
                                &nbsp; Min: <asp:TextBox ID="EndMins" runat="server" CssClass="textEntry" Width="60" /> 
                                &nbsp;&nbsp;&nbsp;
                                <asp:ComboBox ID="ComboBox1" runat="server" DropDownStyle="DropDownList">
                                <asp:ListItem> P.M.</asp:ListItem>
                                <asp:ListItem> A.M.</asp:ListItem>
                                </asp:ComboBox>

                            </p>

                            <p>
                                <asp:Label ID="Label1" runat="server" AssociatedControlID="ScheduleName">Required Participants:</asp:Label>
                               
                            </p>
                            <p>
                                <asp:TextBox ID="NumParticipants" runat="server" Width="60" />

                            </p>


                            
                        </fieldset>
                        <p class="submitButton">
                            <asp:Button ID="AddTimeSlot" runat="server" Text="Add TimeSlot" onclick="AddTimeSlot_Click" 
                                />
                        </p>
                </asp:Panel>
                <asp:GridView ID="ScheduleGrid" runat="server" 
                    onrowcommand="ScheduleGrid_RowCommand">
                    <Columns>
                        <asp:ButtonField CommandName="Register" Text="Register" />
                    </Columns>
                </asp:GridView>
            </asp:Panel>
            <asp:Panel ID="CreateSchedulePanel" runat="server" Visible="false">
                <span class="failureNotification">
                    <asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
                </span>
                <asp:ValidationSummary ID="WorkgroupValidationSummary" runat="server" CssClass="failureNotification"
                    ValidationGroup="WorkgroupValidationGroup" />
                <asp:Panel ID="createTeamForm" runat="server">
                    <div class="accountInfo">
                        <fieldset class="register">
                            <legend>New Schedule</legend>
                            <p>
                                <asp:Label ID="ScheduleNameLabel" runat="server" AssociatedControlID="ScheduleName">Schedule Name:</asp:Label>
                                <asp:RequiredFieldValidator ID="WorkgroupNameRequired" runat="server" ControlToValidate="ScheduleName"
                                    CssClass="failureNotification" ErrorMessage="Schedule Name is required." ToolTip="Schedule Name is required."
                                    ValidationGroup="WorkgroupValidationGroup">*</asp:RequiredFieldValidator>
                            </p>
                            <p>
                                <asp:TextBox ID="ScheduleName" runat="server" CssClass="textEntry"></asp:TextBox>
                            </p>
                            
                        </fieldset>
                        <p class="submitButton">
                            <asp:Button ID="CreateSchedule" runat="server" Text="Create Schedule" 
                                ValidationGroup="CreateSchedule" onclick="CreateSchedule_Click"/>
                        </p>
                </asp:Panel>
            </asp:Panel>
            <div id ="errorPanel">
                    <asp:Panel ID="ErrorPanel" runat="server" Visible="False">
                    <asp:TextBox ID="ErrorText" runat="server" Height="155px" Width="328px" 
                            ForeColor="White" TextMode="MultiLine" BackColor="Black"></asp:TextBox>
                        <br />
                    <asp:Button ID="ErrorClose" runat="server" Text="Close" onclick="ErrorClose_Click"></asp:Button>
                    </asp:Panel>
                </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
